class LoginModel {
  int code;
  String msg;
  String time;
  Data data;

  LoginModel({this.code, this.msg, this.time, this.data});

  LoginModel.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    msg = json['msg'];
    time = json['time'];
    data = json['data'] != null ? new Data.fromJson(json['data']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['msg'] = this.msg;
    data['time'] = this.time;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    return data;
  }
}

class Data {
  UserModel userinfo;

  Data({this.userinfo});

  Data.fromJson(Map<String, dynamic> json) {
    userinfo = json['userinfo'] != null
        ? new UserModel.fromJson(json['userinfo'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.userinfo != null) {
      data['userinfo'] = this.userinfo.toJson();
    }
    return data;
  }
}

class UserModel {
  int id;
  String nickname;
  String mobile;
  int sex;
  String avatar;
  int userType;
  String totalMoney;
  String money;
  int userIsRealname;
  int carUserIsRelaname;
  String reciveEndTime;
  int isBindAlipay;
  int isThird;
  String url;
  String token;
  int userId;
  int expiretime;
  int expiresIn;
  String reciveOrderMinit;
  String alipayAccount;
  String realname;
  String openname;

  UserModel(
      {this.id,
      this.nickname,
      this.mobile,
      this.sex,
      this.avatar,
      this.userType,
      this.totalMoney,
      this.money,
      this.userIsRealname,
      this.carUserIsRelaname,
      this.reciveEndTime,
      this.isBindAlipay,
      this.isThird,
      this.url,
      this.token,
      this.userId,
      this.expiretime,
      this.expiresIn,
      this.reciveOrderMinit,
      this.alipayAccount,
      this.realname,
      this.openname});

  UserModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    nickname = json['nickname'];
    mobile = json['mobile'];
    sex = json['sex'];
    avatar = json['avatar'];
    userType = json['user_type'];
    totalMoney = json['total_money'];
    money = json['money'];
    userIsRealname = json['user_is_realname'];
    carUserIsRelaname = json['car_user_is_relaname'];
    reciveEndTime = json['recive_end_time'];
    isBindAlipay = json['is_bind_alipay'];
    isThird = json['is_third'];
    url = json['url'];
    token = json['token'];
    userId = json['user_id'];
    expiretime = json['expiretime'];
    expiresIn = json['expires_in'];
    reciveOrderMinit = json['recive_order_minit'];
    alipayAccount = json['alipay_account'];
    realname = json['realname'];
    openname = json['openname'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['nickname'] = this.nickname;
    data['mobile'] = this.mobile;
    data['sex'] = this.sex;
    data['avatar'] = this.avatar;
    data['user_type'] = this.userType;
    data['total_money'] = this.totalMoney;
    data['money'] = this.money;
    data['user_is_realname'] = this.userIsRealname;
    data['car_user_is_relaname'] = this.carUserIsRelaname;
    data['recive_end_time'] = this.reciveEndTime;
    data['is_bind_alipay'] = this.isBindAlipay;
    data['is_third'] = this.isThird;
    data['url'] = this.url;
    data['token'] = this.token;
    data['user_id'] = this.userId;
    data['expiretime'] = this.expiretime;
    data['expires_in'] = this.expiresIn;
    data['recive_order_minit'] = this.reciveOrderMinit;
    data['alipay_account'] = this.alipayAccount;
    data['realname'] = this.realname;
    data['openname'] = this.openname;
    return data;
  }
}
